<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<style>
			.area {
				margin: 20px auto 0px auto;
			}
			
			.mui-input-group:first-child {
				margin-top: 20px;
			}
			
			.mui-input-group label {
				width: 22%;
			}
			
			.mui-input-row label~input,
			.mui-input-row label~select,
			.mui-input-row label~textarea {
				width: 78%;
			}
			.mui-input-row {
				position: relative;
			}			
			.mui-input-row a{
				display: inline-block;
				position: absolute;
				right: 12px;
				line-height: 40px;
			}
			.mui-checkbox input[type=checkbox],
			.mui-radio input[type=radio] {
				top: 6px;
			}
			
			.mui-content-padded {
				margin-top: 25px;
			}
			
			.mui-btn {
				padding: 10px;
			}
		</style>
	</head>

	<body>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init()
		</script>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">短信注册</h1>
		</header>
		<div class="mui-content">
			<form class="mui-input-group">
				<div class="mui-input-row">
					<label>手机号</label>
					<input id='account' type="tel" class="mui-input-clear mui-input" placeholder="请输入手机号">
				</div>
				<div class="mui-input-row">
					<label>验证码</label>
					<input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入短信验证码">
					<a href="javascript:;" data-phone="15111111111" data-disabled='false'>获取验证码</a>
				</div>
				<div class="mui-content-padded">
					<button id='reg' class="mui-btn mui-btn-block mui-btn-primary">立即注册</button>
				</div>
			</form>
			<div class="mui-content-padded">
				<p>注册真实可用，注册成功后的用户可用于登录，但是示例程序并未和服务端交互，用户相关数据仅存储于本地。</p>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		mui('.mui-input-row').on('tap','a[data-disabled="false"]',function(){
			mui.toast('发送成功');
			var time = 50;
			(function timeD(){
				setTimeout(function(){
					if (time < 0) {
						mui('.mui-input-row a')[0].innerHTML = '获取验证码';	
						mui('.mui-input-row a')[0].setAttribute('data-disabled','false');
						return false;
					} else{
						mui('.mui-input-row a')[0].innerHTML = time+'s 后再发送';
						mui('.mui-input-row a')[0].setAttribute('data-disabled','true');
						timeD();
					}
					time--;
				},1000)
			})();
		})
	</script>
</html>